/**
 * @program: LeetCode
 * @description: LeetCode : 剑指 Offer 64. 求1+2+…+n
 * @author: WXY
 * @create: 2022-12-10 22:47
 * @Version 1.0
 **/


public class Num064_sumNums {
    public static int sumNums(int n) {
        if (n == 1) return 1;
        return n + sumNums(n - 1);
    }

    public static void main(String[] args) {
        int i = sumNums(100);
        System.out.println(i);
    }
}
